﻿<!DOCTYPE html>

<html>
<head>
    <title>Index</title>
    <meta name="viewport" content="width=device-width" />
    <script src="@Url.Content("~/Scripts/jquery.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/jquery.easyui.min.js")" type="text/javascript"></script>
    <script src="~/Scripts/jquery.tree.js"></script>
    
    <link href="~/Content/tree/css/tree.css" rel="stylesheet" />

    @Styles.Render("~/Content/css")
    @Styles.Render("~/Content/themes/blue/css")
    @Scripts.Render("~/bundles/home")
    <link href="~/treeicon.css" rel="stylesheet" />
    <script type="text/javascript">
        $(function () {
            $("#RightTreeAccordion").accordion({
                fit: true,
                border: false,
                animate: false
            });

            $.post("/Home/GetTreeByEasyui", { "id": '0' }, function (data) {

                if (data == "0") {
                    window.location = "/Account";
                } else {
                    $.each(data, function (i, e) {
                        var id = e.id;
                        $("#RightTreeAccordion").accordion('add', {
                            title: e.text,
                            content: "<ul id='tree" + id + "'></ul>",
                            iconCls: e.iconCls
                        });
                        $.parser.parse();
                        $.post("/Home/GetTreeByEasyui?id=" + id, function (data) {
                            if (data != "0") {
                                $("#tree" + id).tree({
                                    data: data,
                                    url: "/GetTreeByEasyui",
                                    loadFilter: function (data, parent) {
                                        return data;
                                    },
                                    onBeforeExpand:function(node,param){
                                        $("#tree" + id).tree('options').url = "/Home/GetTreeByEasyui?id=" + node.id;
                                    },
                                    onClick: function (node) {
                                        if (node.state == "closed") {
                                            $(this).tree('expand', node.target);
                                        } else if (node.state == "open") {
                                            $(this).tree('collapse', node.target);
                                        } else {
                                            var tabTitle = node.text;
                                            var url = '../../' + node.attributes;
                                            addTab(tabTitle, url, node.iconCls);
                                        }
                                    }
                                });
                            }
                        }, 'json');
                    });
                }

            }, 'json');
        })



    </script>
   
</head>
<body class="easyui-layout">
    <div id="OverTimeLogin" class="easyui-dialog" data-options="closed:true,modal:true">
        <iframe width="726px" scrolling="no" height="497px" frameborder="0" id="iOverTimeLogin"></iframe>
    </div>
    <div data-options="region:'north',border:false,split:true" style="height: 60px;">
        <div class="define-head">
            <div class="define-logo">
                <div id="LoginTopLine">System Manage</div>
                <div id="LoginBotoomLine">MVC4+EF5.0+EasyUI</div>
            </div>
            <div class="define-account">

            </div>
        </div>
    </div>
    <div data-options="region:'west',split:true,title:'菜单列表'" style="width: 200px; height:100%; padding-top: 2px; background-color:#fff; overflow:auto">
        <div id="RightTreeAccordion" class="easyui-accordion" >
        </div>
    </div>
    <div data-options="region:'south',border:false" style="height: 20px;">
        <div class="define-bottom">


        </div>
    </div>
    <div data-options="region:'center',border:false">
        <div id="mainTab" class="easyui-tabs" data-options="fit:true">
            <div title="我的桌面" data-options="closable:true" style="overflow: hidden; background:#fff">
                <iframe scrolling="auto" frameborder="0" src="/SysSample" style="width: 100%; height: 100%;"></iframe>
            </div>
        </div>
    </div>
    <div id="tab_menu" class="easyui-menu" style="width: 150px;">
        <div id="tab_menu-tabrefresh" data-options="iconCls:'icon-reload'">
            刷新
        </div>
        <div id="tab_menu-openFrame">
            在新的窗体打开
        </div>
        <div id="tab_menu-tabcloseall">
            关闭所有
        </div>
        <div id="tab_menu-tabcloseother">
            关闭其他标签页
        </div>
        <div class="menu-sep">
        </div>
        <div id="tab_menu-tabcloseright">
            关闭右边
        </div>
        <div id="tab_menu-tabcloseleft">
            关闭左边
        </div>
        <div id="tab_menu-tabclose" data-options="iconCls:'icon-remove'">
            关闭
        </div>
        <div id="menu" class="easyui-menu" style="width: 150px;">
        </div>
    </div>
</body>
</html>